package vn.axonivy.vision.methodReference;

import java.util.Arrays;
import java.util.List;

public class CallMethods {

	public static void main(String[] args) {

		// reference to constructor method
		Car car = Car.create(Car :: new);
		List<Car> cars = Arrays.asList(car);
		
		// reference to static method
		cars.forEach(Car :: collide );
		
		// reference to instance method with no argument
		cars.forEach(Car :: repair);
		
		// reference to instance method with 1 argument
		Car police = Car.create(Car :: new);
		cars.forEach(police :: follow);
		
		
	}

}
